<?php
/**
 * +----------------------------------------------------------------------
 * | Author: 罗极
 * +----------------------------------------------------------------------
 * | Description: init.php
 * +----------------------------------------------------------------------
 * | User: Administrator Date: 8/20/ 0020 Time: 9:53
 * +----------------------------------------------------------------------
 */
define('BASE_PATH', __DIR__);
define('DS', DIRECTORY_SEPARATOR);


if(substr(PHP_VERSION, 0 ,1) < '7') {
    throw new RuntimeException('PHP版本至少为7.0');
}

require BASE_PATH.DS.'Framework/Loder/Loader.php';

if(!class_exists('Framework\Loader\Loader')) {
    throw new RuntimeException('自动加载文件未能引入!');
}

if(!Framework\Loader\Loader::init()) {
    throw new RuntimeException('自动加载文件未能初始化');
}

function dump(... $mixed)
{
    echo "<pre>";
    foreach($mixed as $m) {
        var_dump($m);
    }
    echo "</pre>";
}


if(class_exists('Framework\\App\\App')) {
    Framework\App\App::run(require BASE_PATH.DS.'Global/Config/Config.php');
} else {
    throw new RuntimeException('框架无法启动!请检查环境');
}

